import yagmail

def send_qq_email(subject, body):
    # QQ邮箱账号和密码（或授权码）
    sender_email = "951500129@qq.com"
    password = "pmsuipkccefnbaig"

    # 收件人邮箱
    receiver_email = "3296936258@qq.com"

    # 初始化yagmail SMTP客户端
    yag = yagmail.SMTP(user=sender_email, password=password, host='smtp.qq.com')

    # 发送邮件
    yag.send(to=receiver_email, subject=subject, contents=body)

# 条件触发

send_qq_email("麦特斯", "测试发送")
